<script setup>
defineProps({
  leftTitle: {
    type: String,
    default: ''
  },
  subTitle: {
    type: String,
    default: ''
  },
  rightTitle: {
    type: String,
    default: ''
  }
})
const emit = defineEmits(['onRight'])
const onTitle = () => {
  emit('onRight')
}
</script>

<template>
  <div class="v-nav-wrapper-title">
    <p class="v-nav-wrapper-title-left">
      <span v-if="leftTitle">{{ leftTitle }}</span
      ><span class="v-nav-wrapper-title-left-sub" v-if="subTitle">{{
        subTitle
      }}</span>
    </p>
    <p class="v-nav-wrapper-title-right" @click="onTitle">{{ rightTitle }}</p>
  </div>
</template>

<style lang="scss" scoped>
.v-nav-wrapper-title {
  width: 100%;
  padding: 2px 4px;
  display: flex;
  align-items: flex-end;
  box-sizing: border-box;
  justify-content: space-between;
  .v-nav-wrapper-title-left {
    margin: 0;
    .v-nav-wrapper-title-left-sub {
      font-size: 14px;
      margin-left: 6px;
      color: #999999;
      display: inline-block;
    }
  }
  .v-nav-wrapper-title-right {
    margin: 0;
    font-size: 14px;
    color: #999999;
  }
}
</style>
